package com.itheima.pinkman.controller;

import com.itheima.pinkman.pojo.ServiceInfo;
import com.itheima.pinkman.pojo.User;
import com.itheima.pinkman.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/user")
public class UserController {
    @Autowired
    UserService userService;
    @RequestMapping("/{id}")
    public User queryById(@PathVariable("id") long id){
        if (id<0) {
            return null;
        }
        return userService.queryById(id);
    }
}
